package com.hbsi.demo1;

/**
 * @author 程奕红
 * @version 1.0
 */
public class YieldThread extends Thread{
    public YieldThread(String name){
        super(name);
    }

    @Override
    public void run() {
        for(int i=0;i<6;i++){
            System.out.println(this.getName()+"    i="+i);
            if(i==3){
                System.out.println("线程让步");
                Thread.yield();
            }
        }
    }
}
